package com.neusoft.elmboot.controller;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.elmboot.po.WalletTrans;
import com.neusoft.elmboot.service.WalletTransService;

@RestController
@RequestMapping("/WalletTransController")
@CrossOrigin
public class WalletTransController {
    @Autowired
    private WalletTransService walletTransService;


    @RequestMapping("/saveTransByPay")
    public int saveTransactionByPay(WalletTrans wt) throws Exception{
        return walletTransService.saveTransByPay(wt);
    }

    @RequestMapping("/saveTransByWithdrawal")
    public int saveTransactionByWithdrawal(WalletTrans wt) throws Exception{
        return walletTransService.saveTransByWithdrawal(wt);
    }

    @RequestMapping("/saveTransByRecharge")
    public int saveTransactionByRecharge(WalletTrans wt) throws Exception{
        return walletTransService.saveTransByRecharge(wt);
    }

    @RequestMapping("/listWalletTransByUserId")
    public List<WalletTrans> listWwalletTransByUserId(String userId){
        return walletTransService.listWalletTransByUserId(userId);
    }
}
